#!/bin/bash

print_info(){
	echo -e "\033[32m $1 \033[0m"
}

print_error(){
	echo -e "\033[31m $1 \033[0m"
}


change_apt_list(){
	print_info "changing apt list to ali mirror"
	src_file=/etc/apt/sources.list
	bak_file=/etc/apt/sources.list.bak
	if [ ! -f ${bak_file} ]
	then
		sudo mv ${src_file} ${bak_file}
		sudo cp ubuntu20.04.list ${src_file}
	fi
	sudo apt update
}

install_zsh(){
	print_info "install zsh"
	sudo apt install -y zsh && sudo chsh -s /usr/bin/zsh
	sudo apt install -y vim
	print_info "zsh installed, please logout and relogin"
}

change_apt_list
install_zsh
